/*************************************************************************
	> File Name: 001.短路原则.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 五  8/20 22:52:29 2021
 ************************************************************************/

#include <stdio.h>

int main() {
    int a = 0, b = 0;
    if ((a++) && (b++)) {
        printf("true\n");
    } else {
        printf("false\n");
    }

    printf("a = %d, b = %d\n", a, b);

    if ((a++) || (b++)) {
        printf("true\n");
    } else {
        printf("false\n");
    }
    printf("a = %d, b = %d\n", a, b);
    return 0;
}
//运行结果:
//false
//a = 1, b = 0
//true
//a = 2, b = 0
